
const dbo = require('../utils/db')
module.exports = {

    /**
     * 检查appid是否可用
     * @param {string} appid 
     * @param {string} key 
     * @returns 
     */
    async check_appid(appid, key) {
        const db = await dbo.db_tts_short_url()
        var info = await db.collection("app").findOne({
            appid: appid
        })
        if (info) {
            if (info['appid_key'] == key) {
                if (info['status'] == 0) {
                    return false
                }
                return true
            } else {
                return false
            }
        } else {
            return false
        }
    },

}